GXNewColorSet
You can use theGXNewColorSet
function to create a new color set object.
gxColorSet GXNewColorSet(gxColorSpace space, long count, const gxSetColor colors[]);
space
- The color space of the color set. You may not specify
gxIndexedSpace
for this parameter.count
- The size of the color space; the number of color values it contains.
colors
- The array of color values that make up the color set.
- function result
- A reference to the newly created color set object.
DESCRIPTION
TheGXNewColorSet
function creates a color set object with an owner count of 1 and returns a reference to it as the function result. You specify the number of colors in the color set in thecount
parameter, and pass the colors to the function in thecolors
array. Note that the array must contain color values of typegxSetColor
.You do not use this function to obtain a copy of a default color set; the
colors
array must contain one or more elements. If it does not,GXNewColorSet
posts acolor_is_nil
error. If you specifygxIndexedSpace
for thespace
parameter,
this function posts a colorSpace_out_of_range error.SPECIAL CONSIDERATIONS
If no error occurs, theGXNewColorSet
function creates a color set object; you are responsible for disposing of that object when you no longer need it.The current implementation of QuickDraw GX restricts the number of colors in a color set to a maximum of 65,535.
ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory color_is_nil count_is_less_than_zero (debugging version) colorSpace_out_of_range (debugging version) number_of_colors_exceeds_implementation_limit SEE ALSO
ThegxSetColor
union is described on page 4-56.To obtain a copy of a default color set object, use the
GXGetDefaultColorSet
function, described on page 4-62.